home *** CD-ROM | disk | FTP | other *** search
- #ifndef RealWoofStream_h
- #define RealWoofStream_h
-
- #include "RealCyberStream.h"
-
- //#include "Debug.h"
-
- #include "WoofLibraryDef.h"
- //#include "EvenMoreTCP.h"
-
- class TBufferManager;
-
-
- // %%%
- typedef int TDoggieTalkConnection;
-
- #define kDoggieDoneRead 1
- #define kDoggieClosed 2
- #define kDoggieError 3
-
- #define kArbitraryBufferSize 512
-
-
- class TRealWoofStream : public TRealCyberStream
- {
- public:
- TRealWoofStream();
- virtual ~TRealWoofStream();
-
- OSErr Initialize(char* url);
-
- virtual StreamStatus GetStreamStatus(Environment* ev);
- virtual OSErr GetStreamError(Environment* ev);
- virtual void GetStatusString(Environment* ev, char* message);
- virtual short GetTotalDataSize(Environment* ev);
-
- virtual OSErr OpenWithCallback(Environment* ev, CyberStreamNotifyUPP callback, void* userData);
- virtual OSErr Open(Environment* ev);
-
- virtual void GetBuffer(Environment* ev, Ptr* buffer, Size* bufferSize);
- virtual void ReleaseBuffer(Environment* ev, Ptr buffer);
-
- virtual void Abort(Environment* ev);
-
- private:
- StreamStatus fStreamStatus;
- short fStreamSize;
- OSErr fStreamError;
- // host address
- char *fNameText;
- short fNameLength;
-
- Boolean fOnHold;
- Boolean fOpen;
- Boolean fImmediate;
-
- TBufferManager* fBufferManager;
-
- TDoggieTalkConnection* fDoggieTalk;
- void* fClientUserData;
- CyberStreamNotifyUPP fClientNotifier;
-
- char* fImmediateBuffer;
- Size fImmediateBufferLength;
-
- void GetSynchronousData(char* buffer, Size* bufferLength);
-
- void DoggieProcessEvent(Environment* ev, unsigned short eventCode, Ptr buffer, Size bufferSize, OSErr result);
-
- static void DoggieNotifier(unsigned short eventCode, Ptr buffer, Size bufferSize, OSErr result, void* userDataPtr);
- static void ContinueReading(void* userData, OSErr result);
-
- };
-
-
- #endif // RealWoofStream_h
-